<?php
/**
 * you register hotkeys in the module's config files
 * you need to specify the pattern eg: 'Ctrl+o' and the path eg: '/digCms/site/build'
 */
class DigUi_Service_Hotkeys
{
    public static function getHotkeys() {
        $hotkeys = array();
        // TODO getting this config is repetitive - push this back to the module service
        foreach( Dig_Service_Module::listAll() as $module => $settings ) {
            if( isset($settings['hotkeys'] )) {
                foreach ($settings['hotkeys'] as $key) {
                    $hotkeys[ $key['pattern'] ] = $key['path'];
                }
            }
        }
        if(count($hotkeys) > 0) {
            return $hotkeys;
        }
    }
}
?>
